package com.yzt.zhuju.gift;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * author : bob
 * date   : 2022/11/30
 * desc   :
 */
public class SendGiftPerson implements Parcelable, Comparable<SendGiftPerson> {

    private String uid;
    private String userName;
    private String avatar;
    private int isSelected; // 0 未选中， 1选中
    private int seatIndex;
    private int isInSeat; // 0不是麦上用户 1是麦上用户
    private String seatEffectUrl;

    public String getSeatEffectUrl() {
        return seatEffectUrl;
    }

    public SendGiftPerson setSeatEffectUrl(String seatEffectUrl) {
        this.seatEffectUrl = seatEffectUrl;
        return this;
    }

    public int getIsInSeat() {
        return isInSeat;
    }

    public void setIsInSeat(int isInSeat) {
        this.isInSeat = isInSeat;
    }

    public int getSeatIndex() {
        return seatIndex;
    }

    public void setSeatIndex(int seatIndex) {
        this.seatIndex = seatIndex;
    }

    public int getIsSelected() {
        return isSelected;
    }

    public void setIsSelected(int isSelected) {
        this.isSelected = isSelected;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public SendGiftPerson(String uid, String userName, String avatar, int isSelected, int seatIndex) {
        this.uid = uid;
        this.userName = userName;
        this.avatar = avatar;
        this.isSelected = isSelected;
        this.seatIndex = seatIndex;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.uid);
        dest.writeString(this.userName);
        dest.writeString(this.avatar);
        dest.writeInt(this.isSelected);
        dest.writeInt(this.seatIndex);
    }

    public SendGiftPerson() {

    }

    protected SendGiftPerson(Parcel in) {
        this.uid = in.readString();
        this.userName = in.readString();
        this.avatar = in.readString();
        this.isSelected = in.readInt();
        this.seatIndex = in.readInt();
    }

    public static final Creator<SendGiftPerson> CREATOR = new Creator<SendGiftPerson>() {
        @Override
        public SendGiftPerson createFromParcel(Parcel source) {
            return new SendGiftPerson(source);
        }

        @Override
        public SendGiftPerson[] newArray(int size) {
            return new SendGiftPerson[size];
        }
    };

    @Override
    public int compareTo(SendGiftPerson other) {
        return this.seatIndex - other.seatIndex;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        SendGiftPerson that = (SendGiftPerson) o;
        return uid.equals(that.uid);
    }
}
